/*
 * FormFillerField.cpp
 *
 *  Created on: 27/01/2009
 *      Author: desadoc
 */

#include "FormFillerField.h"

#include <QVboxLayout>
#include <QLabel>

FormFillerField::FormFillerField(const QString& q, TIPOS t)
{
	QVBoxLayout* l = new QVBoxLayout;
	setLayout(l);

	question = q;
	tp = t;

	QSizePolicy pol(QSizePolicy::Expanding, QSizePolicy::Minimum);

	QLabel* la = new QLabel(question);
	la->setSizePolicy(pol);

	answer = new QLineEdit;
	answer->setSizePolicy(pol);

	l->addWidget(la);
	l->addWidget(answer);

	this->setSizePolicy(pol);
	this->setMinimumSize(900, 0);
	//this->setBaseSize(this->si)
}

FormFillerField* FormFillerField::getEmptyCopy(void)
{
	FormFillerField* f = new FormFillerField(question,tp);
	return f;
}

QString FormFillerField::getQuestion(void)
{
	return question;
}

QString FormFillerField::getAnswer(void)
{
	return answer->text();
}

TIPOS FormFillerField::getType(void)
{
	return tp;
}
